

if __name__ == '__main__':
    print("hello world")
    f = open("1.txt","w", encoding="utf-8")
    f.write("a\na\ra\na")

    print(type(f))
    f.close()

    f = open("2.txt", "w", encoding="utf-8",newline="\n")
    f.write("a\na\ra")
    f.close()

    f = open("3.txt", "w", encoding="utf-8", newline="\n")
    print("%s\na\ra " % "a",end="\n",file=f)
    f.close()